#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<sys/types.h>
int main()
{
    //只有父进程
    printf("Before:PID is %d\n",getpid());

    pid_t id = fork();//fork创建子进程，父子两个执行流分别
    if(id==-1)
    {
        printf("fork error!\n");
        exit(1);
    }
    printf("After:PID is %d, return ID is %d\n",getpid(),id);
    return 0;
}
